import type { RouteRecordRaw } from "vue-router";

// 定义路由
export const routes: RouteRecordRaw[] = [
  {
    path: "/",
    name: "Layout",
    component: () => import("@/layout/index.vue"),
    redirect: "/studioApps",
    children: [
      // 路由配置样例
      // {
      //   name: "Home",
      //   path: "home",
      //   component: () => import("@/views/home/index.vue"),
      //   // 用于 keep-alive 功能，需要与 SFC 中自动推导或显式声明的组件名称一致
      //   // 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
      //   meta: {
      //     title: "home",
      //     icon: "homepage",
      //     affix: true,
      //     keepAlive: true,
      //   },
      // },
      // 顶级菜单配置
      {
        name: "ExploreApps",
        path: "exploreApps",
        component: () => import("@/views/exploreApps/index.vue"),
        // 用于 keep-alive 功能，需要与 SFC 中自动推导或显式声明的组件名称一致
        // 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
        meta: {
          title: "exploreApps",
          icon: "homepage",
          affix: true,
          keepAlive: true,
        },
      },
      {
        name: "StudioApps",
        path: "studioApps",
        component: () => import("@/views/studioApps/index.vue"),
        // 用于 keep-alive 功能，需要与 SFC 中自动推导或显式声明的组件名称一致
        // 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
        meta: {
          title: "studioApps",
          icon: "homepage",
          affix: true,
          keepAlive: true,
        },
      },
      {
        name: "KnowledgeApps",
        path: "knowledgeApps",
        component: () => import("@/views/knowledgeApps/index.vue"),
        // 用于 keep-alive 功能，需要与 SFC 中自动推导或显式声明的组件名称一致
        // 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
        meta: {
          title: "knowledgeApps",
          icon: "homepage",
          affix: true,
          keepAlive: true,
        },
      },
      {
        name: "ToolsApps",
        path: "toolsApps",
        component: () => import("@/views/toolsApps/index.vue"),
        // 用于 keep-alive 功能，需要与 SFC 中自动推导或显式声明的组件名称一致
        // 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
        meta: {
          title: "toolsApps",
          icon: "homepage",
          affix: true,
          keepAlive: true,
        },
      },
      //顶级菜单所属二级菜单配置
      {
        name: "Workflow",
        // 路由组成：顶级菜单路由studioApps/ 二级菜单路由workflow
        path: "studioApps/workflow",
        component: () =>
          import("@/views/studioApps/childrenViews/workFlow/index.vue"),
        meta: {
          title: "工作流面板",
          icon: "homepage",
          affix: true,
          keepAlive: true,
        },
      },
      {
        name: "ApiDoc",
        // 路由组成：顶级菜单路由knowledgeApps/ 二级菜单路由 apiDoc
        path: "knowledgeApps/apiDoc",
        component: () =>
          import("@/views/knowledgeApps/childrenViews/apiDoc/index.vue"),
        meta: {
          title: "API文档库",
          icon: "homepage",
          affix: true,
          keepAlive: true,
        },
      },
    ],
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
  },
];
